package org.wu.framework.lazy.orm.database.jpa.repository.core;

import org.wu.framework.lazy.orm.database.jpa.repository.LazyJpaRepository;
import org.wu.framework.lazy.orm.database.lambda.stream.lambda.LazyLambdaStream;

public class DefaultLazyJapRepositoryMetadata implements LazyJapRepositoryMetadata{

    private final LazyJpaEntityMetadata<?,?,?> jpaEntityMetadata;
    private final LazyJpaRepository<?,?> repository;
    private final LazyLambdaStream lambdaStream;

    public DefaultLazyJapRepositoryMetadata(LazyJpaEntityMetadata<?, ?, ?> jpaEntityMetadata, LazyJpaRepository<?, ?> repository, LazyLambdaStream lambdaStream) {
        this.jpaEntityMetadata = jpaEntityMetadata;
        this.repository = repository;
        this.lambdaStream = lambdaStream;
    }

    /**
     * 用于处理含有注解@select、@insert 的方法
     *
     * @return 返回 LazyLambdaStream 对象
     */
    @Override
    public LazyLambdaStream getLazyLambdaStream() {
        return this.lambdaStream;
    }

    /**
     * 开发人员自定义的 repository 接口属性信息
     *
     * @return LazyJpaEntityMetadata
     */
    @Override
    public LazyJpaEntityMetadata<?, ?, ?> getLazyJpaEntityMetadata() {
        return this.jpaEntityMetadata;
    }

    /**
     * 框架自带的基础方法
     *
     * @return LazyJpaRepository
     */
    @Override
    public LazyJpaRepository<?, ?> getLazyJpaRepository() {
        return this.repository;
    }
}
